package com.sfeir.poc.portal.gui.client.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.sfeir.poc.portal.gui.client.objects.News;

public class NewsWidgetBuilder {
	public List<News> getNewsList(List<String[]> extractedNewsList) {
		final List<News> newsList = new ArrayList<News>();
		String[] strings = null;
		News currentNews = null;

		for (Iterator<String[]> iterator = extractedNewsList.iterator(); iterator.hasNext();) {
			strings = (String[]) iterator.next();
			currentNews = new News();
			currentNews.setDate(strings[0]);
			currentNews.setTitre(strings[1]);
			currentNews.setUrl(strings[2]);
			newsList.add(currentNews);
		}
		return newsList;
	}
}
